<?php

class AreaManager
{
	public static function getProvince($id, $optional = array())
	{
		$model = Province::model();
		return $model->findByPk($optional['id']);
	}
	
	public static function getAmphur($id, $optional = array())
	{
		$model = Amphur::model();
		return $model->findByPk($id);
	}
	
	public static function getDistrict($id, $optional = array())
	{
		$model = District::model();
		return $model->findByPk($id);
	}
	
	public static function getProvinces($optional = array())
	{
		$model = Province::model();
		return $model->findAll();
	}
}